<script language='javascript' src='site/resources/js/jquery.newsletterlayout.js'></script>

Test email will be sent to
<input type="text" name="email">
<button onclick="sendTestNewsletter()">Send test email</button>

<table width="100%">
<tr><td valign="top">
<table>
<tr><td>
Select group
<select name="nlgroup" onchange="nlgroupchanged(this)">
    <option value="0">Select group</option>
    <option value="1">Companies with no homepage/english homepage</option>
    <option value="2">Registered hungarian/foreign companies</option>
    <option value="3">Hungarian/foreign business leaders</option>
    <option value="4">Companies by HS2/4</option>
    <option value="5">Exporter/importer hungarian companies</option>
    <option value="6">Hungarian companies abroad</option>
    <option value="7">Honorary ambassadors</option>
    <option value="8">Hungarian embassies</option>
    <option value="9">Foreign chambers of commerce</option>
    <option value="10">Business partners from hungarian companies</option>
    <option value="11">Not yet updated their profile</option>
    <option value="12">Visitors</option>
    <option value="13">Administrators (for testing)</option>
    <option value="14">Régi top 6öö cégek</option>
    <option value="15">Új cégek</option>
    <option value="16">Szakmai szervezetek</option>
    <option value="17">GYOSZ-ok</option>
    <option value="18">MKIK és vegyes kamarák</option>
    <option value="19">Tiszteletbeli konzulok</option>
    <option value="20">TPA</option>
    <option value="21">US és UK kereskedelmi kamarák</option>
    <option value="22">Ipari parkok</option>
    <option value="23">Vidéki polgármesterek</option>
    <option value="24">Magyar szervezetek</option>
    <option value="25">Nagykövetségek</option>
</select>
</td><td valign="top">
<div id="fp_4" style="display:none;">
<select name="hstype">
    <option value="hs2">HS 2</option>
    <option value="hs4">HS 4</option>
</select>
<input type="text" name="hsvalue">
</div>

<div id="fp_6" style="display:none;">
<select name="countries">
</select>
</div>

</td><td valign="top">
<button onclick="sendNewsletters()">Send newsletters</button>

</td></tr>
</table>
<br>
<textarea name="newsletter" id="newsletter_editor" class="editor" style="width:400px; height:350px;">
</textarea>

</td><td valign="top" style="width:40%">

<h2>Layout</h2>
<div>
<table class="newsletter_layout" width="100%">
    <tr style="height:50px;">
    <td id="1" class="selected">
    <div class="nl_content" style="position:relative;">&nbsp;</div>
    </td>
    <td id="2">
    <div class="nl_content" style="position:relative;">&nbsp;</div>
    </td>
    </tr>
</table>
<div>
</td></tr>
</table>

<script>
function nlgroupchanged() {
}

jQuery("table.newsletter_layout").newsletterLayout({
    connectedEditor : jQuery("textarea#newsletter_editor")
});

function sendNewsletters() {
    callAdminService("newsletter", "sendnewsletter", {
        group : jQuery("select[name='nlgroup']").val(),
        content : getNewsletterLayoutData()
    }, {
        success : function(result) {
            displayMessage("info", "Newsletters have been sent");
        }
    });
}

function sendTestNewsletter() {
    var emailAddr = jQuery("input[name='email']").val();
    callAdminService("newsletter", "sendtestemail", {
        address : emailAddr,
        content : getNewsletterLayoutData()
    }, {
        success : function(result) {
            displayMessage("info", "Test newsletter email has been sent");
        }
    });
}

createEditors("newsletter");

</script>
